/* 
 * GrayRabbit Cms基于J2EE架构内容管理系统
 * Copyright © GrayRabbit Co., Ltd. All rights reserved.
 * Department：运营部
 * 更多信息，请visit:
 * http://code.google.com/p/gray-rabbit-cms/
 */
package org.grayrabbit.cms.dao.system; 

import java.util.List;

import org.grayrabbit.cms.entity.Admin;
import org.grayrabbit.cms.vo.system.AdminBean;

import org.grayrabbit.dao.GenericDao;
import org.grayrabbit.dao.util.Page;
import org.grayrabbit.dao.util.QueryCondition;

/**
 * <b>Admin</b>的DAO接口

 * @version 1.0,创建时间:2011-05-16 15:55:12 
 */
public interface AdminDao extends GenericDao<Admin, String>{
	
	/**
	 * 根据bean组装查询条件
	 */
	public QueryCondition assembly(AdminBean bean);
	/**
	 * 根据bean组装统计查询条件
	 */
	public QueryCondition assemblyCount(AdminBean bean);
	public int count(AdminBean bean);
	/**
	 * 根据bean组装查询条件(名称参数)
	 */
	public QueryCondition assermblyNameQuery(AdminBean bean);
	
	/**
	 * 根据bean组装统计查询条件(名称参数)
	 */
	public QueryCondition assemblyNameQueryCount(AdminBean bean);
	/**
	 * 填充分页组件
	 * @param page
	 * @param bean
	 */
	public List<Admin> findByPage(Page<Admin> page, AdminBean bean);
	
	/**
	 * 检查登录名或昵称的唯一性
	 * @param adminBean
	 * @return
	 */
	public boolean checkNameUnique(AdminBean adminBean,String adminId);
	
	/**
	 * 登录名、密码查询admin
	 * 登陆验证身份
	 */ 
	public Admin getLoginAdmin(String loginName);
	
	public List<Admin> getAdminsByOper(String operTargetId,String operTargetType,String operCode);
	public List<Admin> getAllUsableAdmins();
	public List<Admin>  getAdminsBynames(String loginNames);
	
	/** 启用的的管理员  roleId */
	public List<Admin> findUsableAdminByRoleId(String roleId);
}